<script>
export default {
  name: "RenderFnIcon",
  props: {
    item: {
      type: Object,
      required: true,
    },
  },
  // 遵循最小改动的原则，这里仍然使用 createElement
  render(h) {
    if (typeof this.item.icon === 'function' || (this.item.icon && typeof this.item.icon.render === 'function')) {
      return h(this.item.icon, {
        class: 't-icon',
      });
    }
    return undefined;
  },
}
</script>